<div class="content_spacing">
	<h2>{$smarty.config.ContentPermissions_headline}</h2>
	<br />
	{$smarty.config.ContentPermissions_description}
	<br /><br />
	<form name="permissionForm" id="permissionForm" action="" onsubmit="return false;">
		<input type="hidden" name="obj_id" value="{$obj.obj_id}" />

		<table class="tableList" cellpadding="2" cellspacing="1" border="0" width="100%">
			<tr>
				<th>{$smarty.config.ContentPermissions_tablehead_groups}</th>
				<th><img src="{$CMS_LIBRARY_WEB}famfamfam/icons/eye.png" alt="{$smarty.config.ContentPermissions_read}" title="{$smarty.config.ContentPermissions_read}" border="0" /></th>
				<th><img src="{$CMS_LIBRARY_WEB}famfamfam/icons/key.png" alt="{$smarty.config.ContentPermissions_write}" title="{$smarty.config.ContentPermissions_write}" border="0" /></th>
				<th><img src="{$CMS_LIBRARY_WEB}famfamfam/icons/key_delete.png" alt="{$smarty.config.ContentPermissions_delete}" title="{$smarty.config.ContentPermissions_delete}" border="0" /></th>
				<th><img src="{$CMS_LIBRARY_WEB}famfamfam/icons/key_add.png" alt="{$smarty.config.ContentPermissions_new}" title="{$smarty.config.ContentPermissions_new}" border="0" /></th>
				<th><img src="{$CMS_LIBRARY_WEB}famfamfam/icons/attach.png" alt="{$smarty.config.ContentPermissions_new}" title="{$smarty.config.ContentPermissions_new}" border="0" /></th>
				<th>{$smarty.config.ContentPermissions_classes}</th>
			</tr>
		
		{foreach from=$groups item=group name="grouploop"}
			<tr>
				{if $bgcolor == ""}
					{assign var="bgcolor" value="tablerow_color"}					
				{else}
					{assign var="bgcolor" value=""}					
				{/if}
				<td valign="top">
					<img src="{$CMS_LIBRARY_WEB}famfamfam/icons/icon-group.gif" alt="{$group.group_name|stripslashes|htmlentities}" border="0" /> <strong>{$group.group_name|stripslashes|htmlentities}</strong>
				</td>
				<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $group.permissions.read==1}checked=checked{/if} id="group_{$group.group_id}_read" name="group_{$group.group_id}_read" onclick="ChangeGroupPermissions('{$group.group_id}','read',this.checked);" /></td>
				<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $group.permissions.modify==1}checked=checked{/if} id="group_{$group.group_id}_modify" name="group_{$group.group_id}_modify" onclick="ChangeGroupPermissions('{$group.group_id}','modify',this.checked);" /></td>
				<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $group.permissions.delete==1}checked=checked{/if} id="group_{$group.group_id}_delete" name="group_{$group.group_id}_delete"  onclick="ChangeGroupPermissions('{$group.group_id}','delete',this.checked);" /></td>
				<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $group.permissions.new==1}checked=checked{/if} id="group_{$group.group_id}_new" name="group_{$group.group_id}_new"  onclick="ChangeGroupPermissions('{$group.group_id}','new',this.checked);" /></td>
				<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" id="group_{$group.group_id}_recursive" name="group_{$group.group_id}_recursive"  onclick="ChangeGroupPermissions('{$group.group_id}','recursive',this.checked);" /></td>
				<td class="{$bgcolor}" valign="top">
					<a href="javascript:;" onclick="switchView('sw_group_{$group.group_id}');">{$smarty.config.ContentPermissions_class_preferences} -&raquo;</a>
					<div id="sw_group_{$group.group_id}" style="display: none;">
						{foreach name="classloop" from=$classes item=class}
							<input type="checkbox" name="class_{$class.class_id}" value="1"> {$class.class_name}<br />
						{/foreach}
					</div>
				</td>
			</tr>	
			{foreach from=`$group.user` item=user name="userloop"}
				<tr>   
					<td class="{$bgcolor}" valign="top">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="{$CMS_LIBRARY_WEB}famfamfam/icons/icon-user-orange-small.gif" alt="{$user.user_name}" border="0" /> {$user.user_name}<br />
					</td>
					<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $user.permissions.read==1} checked=checked{/if} id="group_{$group.group_id}_user_{$user.user_id}_read" name="group_{$group.group_id}_user_{$user.user_id}_read" /></td>
					<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $user.permissions.modify==1} checked=checked{/if} id="group_{$group.group_id}_user_{$user.user_id}_modify"  name="group_{$group.group_id}_user_{$user.user_id}_modify" /></td>
					<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $user.permissions.delete==1} checked=checked{/if} id="group_{$group.group_id}_user_{$user.user_id}_delete"  name="group_{$group.group_id}_user_{$user.user_id}_delete" /></td>
					<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" {if $user.permissions.new==1} checked=checked{/if} id="group_{$group.group_id}_user_{$user.user_id}_new"  name="group_{$group.group_id}_user_{$user.user_id}_new" /></td>
					<td class="{$bgcolor}" valign="top"><input type="checkbox" value="1" id="group_{$group.group_id}_user_{$user.user_id}_recursive"  name="group_{$group.group_id}_user_{$user.user_id}_recursive" /></td>
					<td class="{$bgcolor}" valign="top">
						<a href="javascript:void(0);" onclick="editUserClassPermissions('{$user.user_id}');switchView('sw_group_{$group.group_id}_user_{$user.user_id}')">Klassen Einstellungen -&raquo;</a>
						<div id="sw_group_{$group.group_id}_user_{$user.user_id}" style="display: none;">
							{foreach name="classloop" from=$classes item=class}
								<input type="checkbox" name="class_{$class.class_id}" value="1"> {$class.class_name}<br />
							{/foreach}
						</div>
					</td>
				</tr>
			{/foreach}
		 {/foreach}
		</table>
		<br />
		<input type="button" onclick="ContentEditorPermissionsSave()" class="submitbtn" value="{$smarty.config.ContentPermissions_submitbutton}" />
	</form>
</div>
